import http from '../../utils/http.js'


export function getOrderDetail(orderNumber){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/app/order/detail',
		   method:'GET',
		   data:{
			   orderNumber: orderNumber
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}

export function getMyOrderList(orderType){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/app/order/list',
		   method:'GET',
		   data:{
			   orderType:orderType
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}


export function getCarOrderDetail(orderNumber){
	return new Promise((resolve,reject)=>{
		var params={
		   url:'/v1/app/order/car/detail',
		   method:'GET',
		   data:{
			   orderNumber: orderNumber
		   },
		   callBack:(res)=>{
			if(res.code==0){
			 resolve(res)
			}
			else{
			 reject(res.msg)
			}
		}
	  }
	  http.request(params)
	})
}
